<template>
  <div class="headPreviewContainer">
    <el-card class="box-card"
             shadow="never">

      <div class="applicationInfo ">
        <div class="Divider flex-column">
          <span>累计评价</span>
          <vue-count-up class="getEvaluationNum"
                        :end-val="getEvaluationObj?.evaluationCount?getEvaluationObj.evaluationCount:'0'" />

        </div>
        <div class="Divider flex-column">
          <span>本月评价</span>
          <vue-count-up class="getEvaluationNum"
                        :end-val="getEvaluationObj?.monthEvaluation?getEvaluationObj.monthEvaluation:'0'" />

        </div>
        <div class="Divider flex-column"
             style="border-right: none">
          <span>今日评价</span>
          <vue-count-up class="getEvaluationNum"
                        :end-val="getEvaluationObj?.dayEvaluation?getEvaluationObj.dayEvaluation:'0'" />
        </div>
      </div>
    </el-card>
  </div>
</template>
	
<script>
import { getEvaluationList, getEvaluationHead } from '@/api/orderManagement/evaluateList'
import VueCountUp from 'vue-countup-v2';
export default {
  name: 'headPreview',
  data () {
    return {

      getEvaluationObj: null,
      countUpOptions: {
        useEasing: true,
        useGrouping: true,
        separator: ',',
        decimal: '.',
        decimalPlaces: 2,
        prefix: '',
        suffix: ''
      },
    };
  },
  components: {
    VueCountUp
  },
  created () {
    this.init()
  },
  methods: {
    async init () {
      const res = await getEvaluationHead({
        siteId: this.$store.state.site.info.id
      })
      console.log(res)
      this.getEvaluationObj = res
    }
  }
};

</script>
<style lang="less" scoped>
.headPreviewContainer {
  .applicationInfo {
    display: flex;
    align-items: center;
    justify-content: center;
    span {
      color: #757575;
      font-size: 18px;
    }

    .Divider {
      text-align: center;
      width: 30%;
      height: 90px;
      line-height: 40px;
      border-right: 1px solid #ebebeb;
      span {
        color: #000;
        font-family: Inter;
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: normal;
      }
      .getEvaluationNum {
        margin: 3px 0 3px 0;
        color: #1e6ceb;

        font-size: 28px;
      }
    }
  }
}
</style>
	